﻿@{
    ViewBag.Title = "Link";
    var currentUser = Session[NCLCustomerManagement.Common.Constant.Constant.CURRENT_USER]
                       as NCLCustomerManagement.UI.Models.User.AuthenticatedUser;
    var username = currentUser.Username;
    var isAdmin = currentUser.IsAdmin;                       
}
<script src="/Scripts/Customer/Customer.js?time=@DateTime.Now.Millisecond"></script>

<div class="area">
    <div class="row">
        <div class="col-xs-3">
            @if (isAdmin)
            {
                <select id="drRegion" class="form-control input-sm">
                    <option value="-1">Cả 3 miền</option>
                    <option value="0">Miền Bắc</option>
                    <option value="1">Miền Trung</option>
                    <option value="2">Miền Nam</option>
                </select>
            }
            else
            {
                <select id="drRegion" class="form-control input-sm" disabled>
                    <option value="-1">Cả 3 miền</option>
                    <option value="0">Miền Bắc</option>
                    <option value="1">Miền Trung</option>
                    <option value="2">Miền Nam</option>
                </select>
            }
        </div>
      @*  <div class="col-xs-3">
            @if (isAdmin)
            {
                @Html.DropDownList("drCategory", ViewBag.CategorySelectList as SelectList, new { @class = "form-control input-sm" })
            }
            else
            {
                @Html.DropDownList("drCategory", ViewBag.CategorySelectList as SelectList, new { @class = "form-control input-sm", disabled = "true" })
            }
        </div>*@
        <div class="col-xs-3">
            <input id="txtPhone" type="text" class="form-control input-sm" placeholder="Tìm bằng số điện thoại" />
        </div>
        <div class="col-xs-2" style="padding-left: 0px;">
            <div class="btn-toolbar">
                <button id="btnSearch" type="button" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search" title="Tìm"></span></button>
            </div>
        </div>
    </div>
</div>

<div id="customer-list" class="area">
    <div class="btn-grp" style="margin-bottom: 10px;">
        <div class="btn-toolbar">
            <div class="btn-group" style="float: right;">
                @if (isAdmin)
                {
                    <button id="btnNew" class="btn btn-primary" onclick="newCustomer();"><span class="glyphicon glyphicon-plus" title="Thêm khách hàng mới"></span></button>
                    <button id="btnDel" class="btn btn-danger"><span class="glyphicon glyphicon-remove" title="Xóa"></span></button>
                }
                <button id="btnEdit" type="button" class="btn btn-default"><span class="glyphicon glyphicon-edit" title="Sửa"></span></button>

            </div>
        </div>

    </div>
    <table id="list"></table>
    <div id="listPager" class="scroll" style="text-align: center;"></div>
    <div id="listPsetcols" class="scroll" style="text-align: center;"></div>
</div>

<div id="dialog-confirm" title="Xác nhận" style="display: none;">
    <p>
        <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
        Bạn có chắc muốn xóa những khách hàng đã chọn?
    </p>
</div>

<div id="editWindow" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Modal title</h4>
            </div>
            <div class="modal-body">
                <p>One fine body&hellip;</p>
            </div>

        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>